3.17 \(\int x \cos ^2(a+b x+c x^2) \, dx\)

Optimal. Leaf size=126 \[ -\frac{\sqrt{\pi } b \cos \left (2 a-\frac{b^2}{2 c}\right ) \text{FresnelC}\left (\frac{b+2 c x}{\sqrt{\pi } \sqrt{c}}\right )}{8 c^{3/2}}+\frac{\sqrt{\pi } b \sin \left (2 a-\frac{b^2}{2 c}\right ) S\left (\frac{b+2 c x}{\sqrt{c} \sqrt{\pi }}\right )}{8 c^{3/2}}+\frac{\sin \left (2 a+2 b x+2 c x^2\right )}{8 c}+\frac{x^2}{4} \]

[Out]

x^2/4 - (b*Sqrt[Pi]*Cos[2*a - b^2/(2*c)]*FresnelC[(b + 2*c*x)/(Sqrt[c]*Sqrt[Pi])])/(8*c^(3/2)) + (b*Sqrt[Pi]*F
resnelS[(b + 2*c*x)/(Sqrt[c]*Sqrt[Pi])]*Sin[2*a - b^2/(2*c)])/(8*c^(3/2)) + Sin[2*a + 2*b*x + 2*c*x^2]/(8*c)

________________________________________________________________________________________

Rubi [A]  time = 0.0673296, antiderivative size = 126, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {3468, 3462, 3448, 3352, 3351} \[ -\frac{\sqrt{\pi } b \cos \left (2 a-\frac{b^2}{2 c}\right ) \text{FresnelC}\left (\frac{b+2 c x}{\sqrt{\pi } \sqrt{c}}\right )}{8 c^{3/2}}+\frac{\sqrt{\pi } b \sin \left (2 a-\frac{b^2}{2 c}\right ) S\left (\frac{b+2 c x}{\sqrt{c} \sqrt{\pi }}\right )}{8 c^{3/2}}+\frac{\sin \left (2 a+2 b x+2 c x^2\right )}{8 c}+\frac{x^2}{4} \]

Antiderivative was successfully verified.

[In]

Int[x*Cos[a + b*x + c*x^2]^2,x]

[Out]

x^2/4 - (b*Sqrt[Pi]*Cos[2*a - b^2/(2*c)]*FresnelC[(b + 2*c*x)/(Sqrt[c]*Sqrt[Pi])])/(8*c^(3/2)) + (b*Sqrt[Pi]*F
resnelS[(b + 2*c*x)/(Sqrt[c]*Sqrt[Pi])]*Sin[2*a - b^2/(2*c)])/(8*c^(3/2)) + Sin[2*a + 2*b*x + 2*c*x^2]/(8*c)

Rule 3468

Int[Cos[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]^(n_)*((d_.) + (e_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandTrigReduce[
(d + e*x)^m, Cos[a + b*x + c*x^2]^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 1]

Rule 3462

Int[Cos[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]*((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[(e*Sin[a + b*x + c*x^2])/(2
*c), x] + Dist[(2*c*d - b*e)/(2*c), Int[Cos[a + b*x + c*x^2], x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d
 - b*e, 0]

Rule 3448

Int[Cos[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[Cos[(b^2 - 4*a*c)/(4*c)], Int[Cos[(b + 2*c*x)^2/
(4*c)], x], x] + Dist[Sin[(b^2 - 4*a*c)/(4*c)], Int[Sin[(b + 2*c*x)^2/(4*c)], x], x] /; FreeQ[{a, b, c}, x] &&
 NeQ[b^2 - 4*a*c, 0]

Rule 3352

Int[Cos[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]*FresnelC[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)])/
(f*Rt[d, 2]), x] /; FreeQ[{d, e, f}, x]

Rule 3351

Int[Sin[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]*FresnelS[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)])/
(f*Rt[d, 2]), x] /; FreeQ[{d, e, f}, x]

Rubi steps

\begin{align*} \int x \cos ^2\left (a+b x+c x^2\right ) \, dx &=\int \left (\frac{x}{2}+\frac{1}{2} x \cos \left (2 a+2 b x+2 c x^2\right )\right ) \, dx\\ &=\frac{x^2}{4}+\frac{1}{2} \int x \cos \left (2 a+2 b x+2 c x^2\right ) \, dx\\ &=\frac{x^2}{4}+\frac{\sin \left (2 a+2 b x+2 c x^2\right )}{8 c}-\frac{b \int \cos \left (2 a+2 b x+2 c x^2\right ) \, dx}{4 c}\\ &=\frac{x^2}{4}+\frac{\sin \left (2 a+2 b x+2 c x^2\right )}{8 c}-\frac{\left (b \cos \left (2 a-\frac{b^2}{2 c}\right )\right ) \int \cos \left (\frac{(2 b+4 c x)^2}{8 c}\right ) \, dx}{4 c}+\frac{\left (b \sin \left (2 a-\frac{b^2}{2 c}\right )\right ) \int \sin \left (\frac{(2 b+4 c x)^2}{8 c}\right ) \, dx}{4 c}\\ &=\frac{x^2}{4}-\frac{b \sqrt{\pi } \cos \left (2 a-\frac{b^2}{2 c}\right ) C\left (\frac{b+2 c x}{\sqrt{c} \sqrt{\pi }}\right )}{8 c^{3/2}}+\frac{b \sqrt{\pi } S\left (\frac{b+2 c x}{\sqrt{c} \sqrt{\pi }}\right ) \sin \left (2 a-\frac{b^2}{2 c}\right )}{8 c^{3/2}}+\frac{\sin \left (2 a+2 b x+2 c x^2\right )}{8 c}\\ \end{align*}

Mathematica [A]  time = 0.274076, size = 116, normalized size = 0.92 \[ \frac{\sqrt{\pi } (-b) \cos \left (2 a-\frac{b^2}{2 c}\right ) \text{FresnelC}\left (\frac{b+2 c x}{\sqrt{\pi } \sqrt{c}}\right )+\sqrt{\pi } b \sin \left (2 a-\frac{b^2}{2 c}\right ) S\left (\frac{b+2 c x}{\sqrt{c} \sqrt{\pi }}\right )+\sqrt{c} \left (\sin (2 (a+x (b+c x)))+2 c x^2\right )}{8 c^{3/2}} \]

Antiderivative was successfully verified.

[In]

Integrate[x*Cos[a + b*x + c*x^2]^2,x]

[Out]

(-(b*Sqrt[Pi]*Cos[2*a - b^2/(2*c)]*FresnelC[(b + 2*c*x)/(Sqrt[c]*Sqrt[Pi])]) + b*Sqrt[Pi]*FresnelS[(b + 2*c*x)
/(Sqrt[c]*Sqrt[Pi])]*Sin[2*a - b^2/(2*c)] + Sqrt[c]*(2*c*x^2 + Sin[2*(a + x*(b + c*x))]))/(8*c^(3/2))

________________________________________________________________________________________

Maple [A]  time = 0.034, size = 95, normalized size = 0.8 \begin{align*}{\frac{{x}^{2}}{4}}+{\frac{\sin \left ( 2\,c{x}^{2}+2\,bx+2\,a \right ) }{8\,c}}-{\frac{b\sqrt{\pi }}{8} \left ( \cos \left ({\frac{-4\,ca+{b}^{2}}{2\,c}} \right ){\it FresnelC} \left ({\frac{2\,cx+b}{\sqrt{\pi }}{\frac{1}{\sqrt{c}}}} \right ) +\sin \left ({\frac{-4\,ca+{b}^{2}}{2\,c}} \right ){\it FresnelS} \left ({\frac{2\,cx+b}{\sqrt{\pi }}{\frac{1}{\sqrt{c}}}} \right ) \right ){c}^{-{\frac{3}{2}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*cos(c*x^2+b*x+a)^2,x)

[Out]

1/4*x^2+1/8*sin(2*c*x^2+2*b*x+2*a)/c-1/8*b/c^(3/2)*Pi^(1/2)*(cos(1/2*(-4*a*c+b^2)/c)*FresnelC((2*c*x+b)/c^(1/2
)/Pi^(1/2))+sin(1/2*(-4*a*c+b^2)/c)*FresnelS((2*c*x+b)/c^(1/2)/Pi^(1/2)))

________________________________________________________________________________________

Maxima [C]  time = 1.83202, size = 1374, normalized size = 10.9 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(c*x^2+b*x+a)^2,x, algorithm="maxima")

[Out]

1/32*sqrt(2)*(sqrt(2)*(4*c^2*x^2 - c*(I*e^(1/2*(4*I*c^2*x^2 + 4*I*b*c*x + I*b^2)/c) - I*e^(-1/2*(4*I*c^2*x^2 +
 4*I*b*c*x + I*b^2)/c))*cos(-1/2*(b^2 - 4*a*c)/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+ I*b^2)/c)) - 1))*b^2*cos(-1/2*(b^2 - 4*a*c)/c) - (sqrt(p
i)*(erf(sqrt(1/2)*sqrt((4*I*c^2*x^2 + 4*I*b*c*x + I*b^2)/c)) - 1) + sqrt(pi)*(erf(sqrt(1/2)*sqrt(-(4*I*c^2*x^2
 + 4*I*b*c*x + I*b^2)/c)) - 1))*b^2*sin(-1/2*(b^2 - 4*a*c)/c) + ((-2*I*sqrt(pi)*(erf(sqrt(1/2)*sqrt((4*I*c^2*x
^2 + 4*I*b*c*x + I*b^2)/c)) - 1) + 2*I*sqrt(pi)*(erf(sqrt(1/2)*sqrt(-(4*I*c^2*x^2 + 4*I*b*c*x + I*b^2)/c)) - 1
))*b*c*cos(-1/2*(b^2 - 4*a*c)/c) - 2*(sqrt(pi)*(erf(sqrt(1/2)*sqrt((4*I*c^2*x^2 + 4*I*b*c*x + I*b^2)/c)) - 1)
+ sqrt(pi)*(erf(sqrt(1/2)*sqrt(-(4*I*c^2*x^2 + 4*I*b*c*x + I*b^2)/c)) - 1))*b*c*sin(-1/2*(b^2 - 4*a*c)/c))*x)*
sin(1/2*arctan2(2*(4*c^2*x^2 + 4*b*c*x + b^2)/c, 0)))/(c^2*sqrt((4*c^2*x^2 + 4*b*c*x + b^2)/abs(c)))

________________________________________________________________________________________

Fricas [A]  time = 1.47371, size = 316, normalized size = 2.51 \begin{align*} -\frac{\pi b \sqrt{\frac{c}{\pi }} \cos \left (-\frac{b^{2} - 4 \, a c}{2 \, c}\right ) \operatorname{C}\left (\frac{{\left (2 \, c x + b\right )} \sqrt{\frac{c}{\pi }}}{c}\right ) - \pi b \sqrt{\frac{c}{\pi }} \operatorname{S}\left (\frac{{\left (2 \, c x + b\right )} \sqrt{\frac{c}{\pi }}}{c}\right ) \sin \left (-\frac{b^{2} - 4 \, a c}{2 \, c}\right ) - 2 \, c^{2} x^{2} - 2 \, c \cos \left (c x^{2} + b x + a\right ) \sin \left (c x^{2} + b x + a\right )}{8 \, c^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(c*x^2+b*x+a)^2,x, algorithm="fricas")

[Out]

-1/8*(pi*b*sqrt(c/pi)*cos(-1/2*(b^2 - 4*a*c)/c)*fresnel_cos((2*c*x + b)*sqrt(c/pi)/c) - pi*b*sqrt(c/pi)*fresne
l_sin((2*c*x + b)*sqrt(c/pi)/c)*sin(-1/2*(b^2 - 4*a*c)/c) - 2*c^2*x^2 - 2*c*cos(c*x^2 + b*x + a)*sin(c*x^2 + b
*x + a))/c^2

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x \cos ^{2}{\left (a + b x + c x^{2} \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(c*x**2+b*x+a)**2,x)

[Out]

Integral(x*cos(a + b*x + c*x**2)**2, x)

________________________________________________________________________________________

Giac [C]  time = 1.16998, size = 230, normalized size = 1.83 \begin{align*} \frac{1}{4} \, x^{2} + \frac{\frac{\sqrt{\pi } b \operatorname{erf}\left (-\frac{1}{2} \, \sqrt{c}{\left (2 \, x + \frac{b}{c}\right )}{\left (-\frac{i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac{i \, b^{2} - 4 i \, a c}{2 \, c}\right )}}{\sqrt{c}{\left (-\frac{i \, c}{{\left | c \right |}} + 1\right )}} - i \, e^{\left (2 i \, c x^{2} + 2 i \, b x + 2 i \, a\right )}}{16 \, c} + \frac{\frac{\sqrt{\pi } b \operatorname{erf}\left (-\frac{1}{2} \, \sqrt{c}{\left (2 \, x + \frac{b}{c}\right )}{\left (\frac{i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac{-i \, b^{2} + 4 i \, a c}{2 \, c}\right )}}{\sqrt{c}{\left (\frac{i \, c}{{\left | c \right |}} + 1\right )}} + i \, e^{\left (-2 i \, c x^{2} - 2 i \, b x - 2 i \, a\right )}}{16 \, c} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(c*x^2+b*x+a)^2,x, algorithm="giac")

[Out]

1/4*x^2 + 1/16*(sqrt(pi)*b*erf(-1/2*sqrt(c)*(2*x + b/c)*(-I*c/abs(c) + 1))*e^(-1/2*(I*b^2 - 4*I*a*c)/c)/(sqrt(
c)*(-I*c/abs(c) + 1)) - I*e^(2*I*c*x^2 + 2*I*b*x + 2*I*a))/c + 1/16*(sqrt(pi)*b*erf(-1/2*sqrt(c)*(2*x + b/c)*(
I*c/abs(c) + 1))*e^(-1/2*(-I*b^2 + 4*I*a*c)/c)/(sqrt(c)*(I*c/abs(c) + 1)) + I*e^(-2*I*c*x^2 - 2*I*b*x - 2*I*a)
)/c